package hikari.managers;

import com.gooddies.wiring.annotations.PostWiring;
import com.gooddies.wiring.annotations.WiringComponent;
import java.util.HashMap;
import java.util.Map;
import org.swig.jirr.MATERIAL_FLAG;
import org.swig.jirr.SColor;
import org.swig.jirr.SMaterial;

/**
 * @author sad
 */
@WiringComponent(singleton = true, lazy = true)
public class EngineProperties {

    private Map<String, Object> properties = new HashMap<>(50);

    private EngineProperties() {
        
    }
    
    @PostWiring
    private void init(){
        putProperty("viewportGridColor", new SColor(255, 190, 190, 190));
        putProperty("viewportDrawGrid", true);
        putProperty("selectionBoxMaterial", new SMaterial().setEmissiveColor(SColor.WHITE).setFlag(MATERIAL_FLAG.EMF_LIGHTING, false));
        putProperty("lightGizmoMaterialFront", new SMaterial().setEmissiveColor(new SColor(255, 255, 245, 55)).setFlag(MATERIAL_FLAG.EMF_LIGHTING, true));
        putProperty("AxisSize", 10.0f);
        putProperty("rotationGizmoSegmentCount", 40f);
    }

    public Object getProperty(String key) {
        return properties.get(key);
    }

    public SColor getSColorProperty(String key) {
        return (SColor) getProperty(key);
    }

    public SMaterial getSMaterialProperty(String key) {
        return (SMaterial) getProperty(key);
    }

    public Boolean getBooleanProperty(String key) {
        return (Boolean) getProperty(key);
    }

    public float getFloatProperty(String key) {
        return (Float) getProperty(key);
    }

    public final void putProperty(String key, Object value) {
        properties.put(key, value);
    }
}
